<!doctype html>
<html ng-app="DockerPlay" ng-controller="BypassController">
    <head>
        <title>Docker Playground</title>
	    <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
        <link rel="stylesheet" href="/assets/style.css" />
    </head>
    <body class="welcome">
        <div>
            <h1>Welcome!</h1>
            <h2>We're bypassing the Captcha and redirecting you now..</h2>
            <form id="welcomeFormBypass" method="POST" action="/">
                <button id="start" type="submit">Start Session</button>
                <input id="stack" type="hidden" name="stack" value=""/>
                <input id="stack_name" type="hidden" name="stack_name" value=""/>
                <input id="image_name" type="hidden" name="image_name" value=""/>
            </form>
        </div>
    </body>

    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>

    <script src="/assets/app.js"></script>
    <script>
        function getParameterByName(name, url) {
            if (!url) url = window.location.href;
            name = name.replace(/[\[\]]/g, "\\$&");
            var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
                results = regex.exec(url);
            if (!results) return null;
            if (!results[2]) return '';
            return decodeURIComponent(results[2].replace(/\+/g, " "));
        }

        var stack = getParameterByName('stack');
        if (stack) {
            document.getElementById('stack').value = stack;
        }
        var stackName = getParameterByName('stack_name');
        if (stack) {
            document.getElementById('stack_name').value = stackName;
        }
        var imageName = getParameterByName('image_name');
        if (stack) {
            document.getElementById('image_name').value = imageName;
        }
    </script>
</html>
